<%@page import="com.dlry.entity.DlLoginuser"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>动力燃油部</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/jquery-3.1.1.js"></script>
<!-- 必须在jquery之后添加 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/layer/layer.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//登录
		$('#loginBtn').click(function() {
			/* layer.open({
				title : "登录",
				type : 2,
				area : [ '420px', '350px' ],
				content : "login.jsp"
			}); */
			window.location.href = "login.jsp";
		});
		$('#logoutBtn').click(function() {
			window.location.href = "logoutAction.action";
		});
		/* $('#travel').click(function() {
			layer.msg("点击里登记出差");
		});
		$('#leave').click(function() {
			layer.msg("点击里登记请假");
		}); */

	});
</script>
<script type="text/javascript">
	function booking(e) {
		window.location.href = "${ pageContext.request.contextPath }/bookingCalendar?roomId="
				+ e.id;
	}
</script>
<style type="text/css">
.lighting {
	color: red;
	animation: myfirst 2s infinite;
}

@
keyframes myfirst { 0% {
	color: red;
}

25%
{
color
 
:
 
yellow
;
}
50%
{
color
 
:
 
blue
;
}
100%
{
color
 
:
 
green
;
 
}
}
body {
	font-family: arial, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;
}
</style>
</head>
<body background="">
	<center>
		<%
			HttpSession s = request.getSession();
		%>
		<table style="width: 96%; height: 1200px; min-width: 1000px;">
			<!-- 第二行 -->
			<tr height="600px">
				<!-- 第一列 -->
				<td
					style="width: 25%; vertical-align: top; background-color: rgb(220, 245, 255);">
					<table width="100%" border="1">
						<tr>
							<th><img id="travel" alt="aa"
								style="opacity: 0.8; filter: alpha(opacity = 80);"
								src="${pageContext.request.contextPath }/resources/images/businesstravel.png"
								onclick="window.location.href = 'usermanager/travel'"></th>
						</tr>
					</table>
					<div style="margin: 10px 10px 10px 10px;">
						<h4>部门共享链接:</h4>
						<ul>
							<c:forEach items="${ shares }" var="share" varStatus="statu">
								<li><a
									style="text-decoration: none; letter-spacing: 0.2em;"
									href="file:${ share.address }">${ share.name } <br> &nbsp;${ share.address }
								</a></li>
							</c:forEach>
						</ul>
					</div>
				</td>
				<!-- 第二列 -->
				<td style="width: 50%">
					<table
						style="width: 100%; height: 100%; border-collapse: collapse;"
						bordercolor="gray" border="0" cellpadding="1">
						<tr>
							<th><img alt="notification"
								src="${pageContext.request.contextPath }/resources/images/notification.png">
								<a style="float: right; margin-top: 28px; text-decoration: none"
								align="right" href="morenews">more</a></th>
						</tr>
						<tr>
							<td>
								<ul style="text-align: left;">
									<c:forEach var="notification" items="${ notifications }"
										varStatus="statu">
										<li style="height: 40px; white-space: nowrap;"><a
											target="_blank" style="text-decoration: none"
											href="${ pageContext.request.contextPath }/notification?nId=${ notification.id}">${ notification.title }&nbsp;</a>
											<div
												style="color: gray; white-space: nowrap; display: inline">
												${ notification.timestr}</div> <c:choose>
												<c:when test="${notification.toped }">
													<div style="display: inline; color: red;">top</div>
												</c:when>
												<c:when test="${ statu.index < 10 }">
													<div class="lighting" style="display: inline">new</div>
												</c:when>
											</c:choose></li>
									</c:forEach>
								</ul>
							</td>
						</tr>
					</table>
				</td>
				<!-- 第三列 -->
				<td
					style="width: 25%; vertical-align: top; background-color: rgb(220, 245, 255);">
					<table width="100%" border="1">
						<tr>
							<th><img id="leave" alt="aa"
								src="${pageContext.request.contextPath }/resources/images/leave.png"
								onclick="window.location.href = 'usermanager/leave'"></th>
						</tr>
					</table>
				</td>
			</tr>
			<!-- 第三行 -->
			<tr>
				<td colspan="3" align="center"
					style="vertical-align: top; border-top: 5px solid #01d862;"><img
					alt="appointment"
					src="${pageContext.request.contextPath }/resources/images/appointment.png">
					<%--table-layout: fixed设置均分列 --%>
					<table border="1" width="100%" bordercolor="grean"
						style="table-layout: fixed;" height="330px">
						<tr>

							<c:forEach items="${ rooms }" var="room" varStatus="statu">
								<td align="center" height="40px"
									<c:if test="${ statu.index % 2 == 1}">style="background-color: rgba(140, 137, 99, 0.33);" </c:if>><a
									id="${room.id}" onclick="booking(this)"
									href="javascript:void(0)" style="text-decoration: none">${ room.roomName }&nbsp;&nbsp;${room.roomNumber}
								</a></td>
							</c:forEach>
						</tr>
						<tr>
							<c:forEach begin="1" end="${ rooms.size() }" step="1"
								varStatus="statu">
								<td align="center" height="30px"
									<c:if test="${ statu.index % 2 == 0}">style="background-color: rgba(140, 137, 99, 0.33);" </c:if>>
									<%
										out.print("会议安排");
									%>
								</td>
							</c:forEach>
						</tr>
						<tr>
							<c:forEach var="room" items="${ rooms }" varStatus="statu">
								<td align="left"
									style="vertical-align: top; <c:if test='${ statu.index % 2 == 1}'>background-color: rgba(140, 137, 99, 0.33);' </c:if>">
									<ul type="circle" style="padding-left: 20px;">
										<c:forEach items="${ roomBookingMap[room.id] }" var="element"
											varStatus="s2">
											<li style="margin-top: 10px;">${ element.durationTime }<br>会议名称：
												<div style="color: red; display: inline;">
													<c:out value="${ element.name }"></c:out>
												</div>
											</li>
										</c:forEach>
									</ul>
								</td>
							</c:forEach>
						</tr>
					</table></td>
			</tr>
		</table>
	</center>
</body>
</html>